<table class="forum">
    <thead>
        <tr>
            <th width="20%">版块名称</th>
            <th width="51%">版块说明</th>
            <th width="5%">主题</th>
            <th width="24%">最后发表</th>
        </tr>
    </thead>
    <tbody>
<?php
    $modelForumTopic = new Ms_Model_ForumTopic();
    $modelTopic = new Ms_Model_ForumTopic();
    foreach($this->forums as $forums){
        echo "<tr class='title'>";
            echo "<td colspan='4'><strong>".$forums['catname']."</strong></td>";
        echo "</tr>";
        foreach($forums['forum'] as $forum){
            echo "<tr>";
                echo "<td><a href='community/forum/id/".$forum['id']."'>".$forum['name']."</a></td>";
                echo "<td>".$forum['description']."</td>";
                echo "<td>";
                $topicNum = $modelForumTopic->countTopics($forum['id']);
                echo $topicNum;
                echo "</td>";
                echo "<td>";
                // 最后发表
                $latestTopic = $modelTopic->latestTopic($forum['id']);
                echo  "<a href='community/topic/id/".$latestTopic['id']."'>".$latestTopic['subject']."</a>";
                echo "</td>";
            echo "</tr>";
        }
    }
?>
    </tbody>
</table>
